﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DHQGHN.PM2.Models.DHQG
{
    public class KeHoachThucHienModel
    {
        public int KH_THUC_HIEN_ID { get; set; }
        public int NAM_KE_HOACH_ID { get; set; }
        public int DON_VI_ID { get; set; }
        public int CHI_TIEU_ID { get; set; }
        public string GIA_TRI { get; set; }
        public int MOC_KIEM_SOAT_ID { get; set; }
        public int NGUOI_DUNG_ID { get; set; }
        public DateTime LASTUPDATED { get; set; }
        public int STATUS_ID { get; set; }
        public bool IS_CURRENT { get; set; }

        public KeHoachThucHienModel()
        {
            KH_THUC_HIEN_ID = 0;
            LASTUPDATED = DateTime.Today;
        }

        public KeHoachThucHienModel(DAL.Models.DHQG.KeHoachThucHien model)
        {
            this.KH_THUC_HIEN_ID = model.KH_THUC_HIEN_ID;
            this.NAM_KE_HOACH_ID = model.NAM_KE_HOACH_ID;
            this.DON_VI_ID = model.DON_VI_ID;
            this.CHI_TIEU_ID = model.CHI_TIEU_ID;
            this.GIA_TRI = model.GIA_TRI;
            this.MOC_KIEM_SOAT_ID = model.MOC_KIEM_SOAT_ID;
            this.NGUOI_DUNG_ID = model.NGUOI_DUNG_ID;
            this.LASTUPDATED = model.LASTUPDATED;
            this.STATUS_ID = model.STATUS_ID;
            this.IS_CURRENT = model.IS_CURRENT;
        }

        public DAL.Models.DHQG.KeHoachThucHien ToDALModel()
        {
            DAL.Models.DHQG.KeHoachThucHien model = new DAL.Models.DHQG.KeHoachThucHien();
            model.KH_THUC_HIEN_ID = this.NAM_KE_HOACH_ID;
            model.NAM_KE_HOACH_ID = this.NAM_KE_HOACH_ID;
            model.DON_VI_ID = this.DON_VI_ID;
            model.CHI_TIEU_ID = this.CHI_TIEU_ID;
            model.GIA_TRI = this.GIA_TRI;
            model.MOC_KIEM_SOAT_ID = this.MOC_KIEM_SOAT_ID;
            model.NGUOI_DUNG_ID = this.NGUOI_DUNG_ID;
            model.LASTUPDATED = DateTime.Now;
            model.STATUS_ID = this.STATUS_ID;
            model.IS_CURRENT = this.IS_CURRENT;

            return model;
        }
    }
}